/*var express = require('express');

var app = express();*/

let WebSocket = require('ws');//记得安装ws

let wss = new WebSocket.Server({port:3000});
wss.on('connection',function(ws) {
  ws.on('message', function (data) {
    console.log(data);
    ws.send('cll')
  });
})

/*app.listen(3000, function () {
  console.log('app is running');
});
app.use('/', express.static('./resource'));

app.get('/student', (request, response) => {
  console.log(123);
  response.append('Access-Control-Allow-Origin', "*");
  response.send(JSON.stringify('lwf'))
});

app.get('/text', (request, response) => {
  let {callback=Function.prototype}=request.query;
  let data='lwf'

  console.log(111,callback)

  //将函数名和将要返回的数据拼接成字符串然后反馈给浏览器
  response.send(`${callback}(${JSON.stringify(data)})`)
});*/

